<?php
use yii\helpers\Url;

?>

<style>
    .table tr:last-child:hover td{background:#fff;}
    .guide{position: absolute;left: -231px;top: -82px;display: none;}
    @media (max-width: 1440px) {
        .guide {
            left: -187px;
        }
    }
    .guide-con{position: relative;}
    .guide-con-tip{padding-top: 10px;width: 138px;height: 76px;background: url("<?=Yii::getAlias('@web/backend/img/financial/guide_tip1.png');?>") no-repeat;text-align: center;color: #f78ba7;}
    .guide-con .person {
        position: absolute;
        right: -70px;
        top: 62px;
    }
    .msgTips .guide{top: -12px;-webkit-transition:all .6s linear;-moz-transition: all .6s linear;transition: all .6s linear; }
    .dropdown:focus, .btn:focus{outline: none;}
    a:focus,:focus{outline: none;}
    .table tr:hover input[type=text]{ background: #fff}
</style>

	<?=$this->render('../_nav');?>
    <div id="myTabContent" class="container">
    	<div class="mart20"></div>
    	<div class="w20 form-inline">
    		<div class="form-group">
	    		<label class="mr10" for="ordertime" >日期</label><input id="ordertime" name="ordertime" type="text" value="" style="width:220px;" class="laydate-icon lh45"/>
    		</div>
    	</div>
    	<div class="clearfix"></div>
    	<div class="mart20"></div>
    	<div class="userinfo" style="position: relative;">
            <div class="guide">
                <div class="guide-con">
                    <div class="guide-con-tip">收银时,<br>最先添加会员信息哦</div>
                    <img class="person" src="<?=Yii::getAlias('@web/backend/img/financial/guide.gif');?>" alt=""/>
                </div>
            </div>
    		<div class="userinfo_text">
    			<p>会员信息</p>
    		</div>
    		<div class="user">
    			<!-- <p>王三&nbsp;&nbsp;|&nbsp;&nbsp;139998779&nbsp;&nbsp;|&nbsp;&nbsp;VIP会员&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;储值卡：<em>5400</em>&nbsp;&nbsp;|&nbsp;&nbsp;欠款:&nbsp;&nbsp;<em>2500</em>&nbsp;&nbsp;|&nbsp;&nbsp;赠送剩余：<em>2000</em></p>
    			<span class="btn btn-success">更改会员</span> -->
    			<i class="fa fa-plus add" dtitle="会员列表" durl="<?=Url::toRoute(['financial/cashier','action'=>'getUserlist'])?>"></i>
    		</div>
    	</div>
    	<div class="clearfix"></div>
    	<div class="mart20"></div>
    	<div class="menu">
	    	<div class="dropdown">
                <span class=" btnMd btn_disabled" style="padding-left: 0; width: 90px" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <button id="dLabel" type="button" class="dLabel btn btn-success"  disabled style="background: 0;border: 0; width: 100%;">
                        <p style="float:left; margin:0;">添加</p>
                        <i class="glyphicon glyphicon-plus-sign" style="float:right; margin-top:2px;"></i>
                    </button>
                </span>
	  			<ul class="dropdown-menu" aria-labelledby="dLabel">
	    			<li><a href="javascript:void(0);" class="card_add" dtitle="选择充值卡" durl="<?=Url::toRoute(['financial/cashier','action'=>'balancecard'])?>">充值卡</a></li>
	    			<li><a href="javascript:void(0);" class="add" dtitle="添加新疗程卡" durl="<?=Url::toRoute(['financial/cashier','action'=>'healthcardlist'])?>">疗程卡</a></li>
	    			<li><a class="add" href="javascript:void(0);" durl="<?=Url::toRoute(['financial/cashier','action'=>'homeproductlist'])?>" dtitle="家居产品">家居产品</a></li>
	    			<li><a class="add" href="javascript:void(0);" durl="<?=Url::toRoute(['financial/cashier','action'=>'cooperationprojectslist'])?>" dtitle="合作项目">合作项目</a></li>
	    			<li><a class="add" href="javascript:void(0);" durl="<?=Url::toRoute(['financial/cashier','action'=>'serviceprojectslist'])?>" dtitle="服务项目">服务项目</a></li>
	  			</ul>
			</div>
			<div class="dropdown">
                <a class=" btnMd btn_disabled" style="padding-left: 0; width: 90px" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <button id="dLabel" type="button" class="dLabel btn btn-success"  style="background: 0;border: 0; width: 100%" disabled>
                        <p style="float:left; margin:0;">退款</p>
                        <i class="glyphicon glyphicon-play-circle" style="float:right; margin-top:2px;"></i>
                    </button>
                </a>
	  			<ul class="dropdown-menu" aria-labelledby="dLabel">
	    			<li><a class="price_add" href="javascript:void(0);" dtitle="退款结算" durl="<?=Url::toRoute(['financial/cashier','action'=>'cashrefund'])?>">退款</a></li>
	    			<li><a class="add" href="javascript:void(0);" dtitle="退疗程卡" durl="<?=Url::toRoute(['financial/cashier','action'=>'healthcardrefund'])?>">退疗程</a></li>
	    			<li><a class="card_add" href="javascript:void(0);" dtitle="退储值卡" durl="<?=Url::toRoute(['financial/cashier','action'=>'balancecardrefund'])?>">退储值卡</a></li>
	  			</ul>
			</div>
			<div class="dropdown">
                <a class="add btnMd" style="padding-left: 0; width: 90px" dtitle="缴欠费" href="javascript:;" durl="<?=Url::toRoute(['financial/cashier','action'=>'arrearslist'])?>">
                    <button id="dLabel" type="button" class="btn btn-success" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="background: 0;border: 0; width: 100%">
                        <p style="float:left; margin:0;">缴欠款</p>
                        <span class="badge" style="padding:4px 6px; top:-18px; right:-22px	; background:#FF3E7A; color:#fff; " ><?=$count?></span>
                    </button>
                </a>
			</div>
    	</div>
        <div class="tab-pane fade in active">
        	<div class="hide inputParam">

        	</div>
        	<div style="margin-top:20px;"></div>
        	<div style="float:left;">
	        </div>
            <div class="clearfix"></div>
            <div style="margin-top:20px;"></div>
            <div class="right_kj">
                <div class="table-responsive">
                    <table class="table edit_edit table-bordered">
                        <thead>
                        <tr>
                            <th>消费类型</th>
                            <th>服务/产品名称</th>
                            <th>零售价</th>
                            <th>卖价</th>
                            <th>数量</th>
                            <th>总金额</th>
                            <th>提成人员</th>
                            <th>销售业绩</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!--<tr><td colspan='9'><p style="font-size:16px; cursor:pointer;" durl='<?=Url::toRoute('employee/add')?>' class="add"><i class="fa fa-plus"></i>  增加员工</p></td></tr>-->
                        </tbody>
                    </table>
                    <div class="page"></div>
                    <a class="clearingBtn clear_add btnBg mt20 mr30 pull-right hide" durl="<?=Url::toRoute(['financial/cashier','action'=>'clearing'])?>" dtitle="结算单" style="cursor: pointer;">结算</a>
                </div>
            </div>
        </div>
    </div>

<?php $this->beginBlock('js_index_end') ?>
    $(function(){
    laydate.skin('meelier');
    laydate({
    format:'YYYY-MM-DD hh:mm:ss',
    elem: '#ordertime',
    istime:true,
    istoday: true,
    max: laydate.now()
});
        $('.table tr td').dblclick(function(){
            $(this).find('input').removeAttr("readonly").addClass('read');
            if(typeof($(this).find('input').attr('readonly')) =="undefined"){
                if($(this).find('a').length<1){
                    //$(this).append('<a class="ok edit" href="#">确定</a>');
                    $(this).parent().find('.fadeBox').show();
                    $(this).parent().find('.del').hide();
                }
            }
        $('.ok').click(function(){
            $(this).parent().find('input').attr('readonly',true).removeClass('read');
            $(this).parent().parent().find('.fadeBox').hide();
            $(this).parent().parent().find('.del').show();
            $(this).remove();
        })
            $('.rest').click(function(){
            $(this).parent().hide();
            $(this).parent().parent().find('.del').show();
            $(this).parent().parent().parent().find('input').attr('readonly',true).removeClass('read');
            $(this).parent().parent().parent().find('.ok').remove();
        })
    })
    $('.add-recharge').click(function(e){
        e.preventDefault();
        $(this).next().find('tbody').append('<tr><form id="test" method="post" role="form" action="<?=Url::toRoute('config/add')?>"><td><input class="read" type="text"/></td><td><input class="read" type="text"/></td><td><input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>"><input type="submit" value="保存" class="edit" /></a><a href="#" class="edit restb" style="margin-left: 5px;">取消</a></td></form></tr>');
        $('.restb').click(function(){
            $(this).parent().parent().remove();
        })
    })
})
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js_index_end'], $this::POS_END); ?>
<?php $this->registerCssFile("@web/system/financial/cashier/index.css",['position'=>$this::POS_END]);?> 
<?php $this->registerJsFile("@web/system/financial/cashier/index.js",['position'=>$this::POS_END]);?>